import request, { scope } from '../../utils/request';

const addressUrl = scope('user/pay-info');

export const addPayInfo = async (orderId) => {
  return request({
    url: addressUrl(`createPayInfo/${orderId}`),
    method: 'post',
  });
};

export const findPayStatus = (payInfoId) => {
  return request({
    url: addressUrl('queryPayStatus'),
    method: 'post',
    data: { id: payInfoId },
  });
};

export const updatePayStatus = (payInfoId) => {
  return request({
    url: addressUrl('update'),
    method: 'post',
    data: { id: payInfoId },
  });
};

export const delPayInfo = (payInfoId) => {
  return request({
    url: addressUrl('del'),
    method: 'post',
    data: { id: payInfoId },
  });
};
